/*LICENSE_BEGIN
 * ******************************************************************
 * Copyright 2006 by the Dainamite Robocup-Team at the
 * DAI-Labor, TU-Berlin (www.dai-labor.de)
 * 
 * Members of Dainamite are:
 * Holger Endert
 * Robert Wetzker
 * Thomas Karbe
 * Axel Heßler
 * Philippe Bütter
 * Felix Brossmann
 * 
 * Licensed under the GNU GPL (General Public License) Free Software 
 * License, Version 2. You may use this file only in compliance with 
 * the License. You may obtain a copy of the License at:
 * 
 * http://www.fsf.org/licensing/licenses/gpl.txt
 * ******************************************************************
LICENSE_END*/
package robocup.component.actions;

/**
 * A reconnect action, which can be used to re-establish a connection to the
 * server after a connection was resetted.
 */
public class ReconnectAction extends Action {
	/**
	 * The teamname of the agent.
	 */
	private String _teamName;

	/**
	 * The number of the agent, which should, which should be controlled.
	 */
	private int _number;

	/**
	 * Constrcutor of a reconnect action - causes the agent ro reconnect to the
	 * server
	 * 
	 * @param teamName
	 *            the teamname of the agent
	 * @param number
	 *            the <unum> of the agent
	 */
	public ReconnectAction(String teamName, int number) {
		this._teamName = teamName;
		this._number = number;
	}

	/**
	 * Returns the actions string representation:
	 * @return 
	 * (reconnect &lt;teamName&gt; &lt;number&gt;)<br><br>
	 */
	@Override
	public String toString() {
		StringBuffer buf = new StringBuffer();
		buf.append("(reconnect ");
		buf.append(this._teamName);
		buf.append(" ");
		buf.append(this._number);
		buf.append(")");

		return buf.toString();
	}
}
